﻿/****************************************************
	文件：HConst.cs
	作者：HuskyT
	邮箱：1005240602@qq.com
	日期：2021/06/27 18:10:42
	功能：框架 常量
*****************************************************/

using System.IO;
using UnityEngine;

namespace HTFramework
{
    /*
     * 框架代码规范：
     * 1.枚举：E_xxxx
     * 2.常量：ABCDE
     * 3.私有/保护变量：mRand
     * 4.公共变量：Rand
     *
     * 
     */

    /// <summary>
    /// 框架 常量
    /// </summary>
    public class HConst 
    {
        /// <summary>
        /// 公共常量
        /// </summary>
        public static class CommonConst
        {
            //-------------------- FrameCount --------------------//

            #region FrameCount

            /// <summary>
            /// 逻辑帧 帧率
            /// </summary>
            public const int LOGIC_FRAME_COUNT = 30;

            /// <summary>
            /// 渲染帧 帧率
            /// </summary>
            public const int VIEW_FRAME_COUNT = 60;

            /// <summary>
            /// Unity目标帧率
            /// </summary>
            public const int ApplicationFrameCount = 60;

            #endregion


            //-------------------- 命名空间 --------------------//

            #region 命名空间

            /// <summary>
            /// 框架基础命名空间
            /// </summary>
            public const string NAME_SPACE = "HTFramework";

            #endregion
        }

        public class EventConst
        {
            //-------------------- 事件 ID --------------------//

            #region 事件 ID

            /// <summary>
            /// 框架事件起始Id
            /// </summary>
            public const int FRAMEWORK_EVENT_ID_BEGIN = 0;

            /// <summary>
            /// 全局事件起始Id
            /// </summary>
            public const int GLOBAL_EVENT_ID_BEGIN = 1000;

            /// <summary>
            /// UI事件起始Id
            /// </summary>
            public const int UI_EVENT_ID_BEGIN = 4000;

            #endregion
        }

        public class AddressableConst
        {
            //--------------- Group Name ---------------//

            #region Group Name

            /// <summary>
            /// Addressable Assets 组名：UI 预制体
            /// </summary>
            public const string ADDRESSABLE_ASSETS_GROUP_NAME_PREFAB_UI = "prefab_ui_group";

            /// <summary>
            /// Addressable Assets 组名：UI 图集
            /// </summary>
            public const string ADDRESSABLE_ASSETS_GROUP_NAME_ATLAS_UI = "atlas_ui_group";

            #endregion
        }

        public class UIConst
        {
            //-------------------- Base Layer order --------------------//

            #region Base Layer order

            /// <summary>
            /// Bottom 层基础层级 1000
            /// </summary>
            public const int UILAYER_ORDER_BOTTOM = 1000;

            /// <summary>
            /// HUD 层基础层级 2000
            /// </summary>
            public const int UILAYER_ORDER_HUD = 2000;

            /// <summary>
            /// Mask 层基础层级 3000
            /// </summary>
            public const int UILAYER_ORDER_MASK = 3000;

            /// <summary>
            /// Popup 层基础层级 4000
            /// </summary>
            public const int UILAYER_ORDER_POPUP = 4000;

            /// <summary>
            /// Guide 层基础层级 5000
            /// </summary>
            public const int UILAYER_ORDER_GUIDE = 5000;

            /// <summary>
            /// Loading 层基础层级 6000
            /// </summary>
            public const int UILAYER_ORDER_LOADING = 6000;

            /// <summary>
            /// Notice 层基础层级 7000
            /// </summary>
            public const int UILAYER_ORDER_NOTICE = 7000;

            /// <summary>
            /// Test 层基础层级 8000
            /// </summary>
            public const int UILAYER_ORDER_TEST = 8000;

            #endregion
        }


        /// <summary>
        /// 资源路径
        /// </summary>
        public static class ResPath
        {
            /// <summary>
            /// 脚本模板数据 资源路径
            /// </summary>
            public const string ASSET_SCRIPT_TEMPLATE_DATA =
                "Assets/HTFramework/Resources/ScriptTemplate/0-ScriptTemplateData.asset";

            /// <summary>
            /// UI预制体所在文件夹路径
            /// </summary>
            public const string PREFAB_UI_FOLDER_PATH = "Assets/GameData/Prefab/UI/";

            /// <summary>
            /// UI图集所在文件夹路径
            /// </summary>
            public const string ATLAS_UI_FOLDER_PATH = "Assets/GameData/Atlas/UI/";

            /// <summary>
            /// UI图片所在文件夹路径
            /// </summary>
            public const string SPRITE_UI_FOLDER_PATH = "Assets/GameData/Sprite/Atlas/UI/";

            /// <summary>
            /// UI脚本所在文件夹路径
            /// </summary>
            public const string SCRIPT_UI_FOLDER_PATH = "Assets/Scripts/UI/";

            /// <summary>
            /// 自动生成的UI脚本的备份文件夹路径
            /// </summary>
            public static readonly string SCRIPT_UI_BACKUP_FOLDER_PATH =
                $"{Path.Combine(Application.dataPath, "../")}HTFrameworkTemp/AutoGenerateUIScriptBackups/";

            /// <summary>
            /// UI 图片图集数据临时存放文件夹路径
            /// </summary>
            public static readonly string UI_SPRITE_ATLAS_DATA_TEMP_FOLDER_PATH =
                $"{Path.Combine(Application.dataPath, "../")}HTFrameworkTemp/UISpriteAtlasDataTemp/";

            /// <summary>
            /// UI 预制体链接与剥离数据存储路径
            /// </summary>
            public static readonly string UI_LINK_DATA_SAVE_PATH =
                $"{Path.Combine(Application.dataPath, "../")}HTFrameworkTemp/UIPrefabLinkData/UIPrefabLinkData.json";
        }
    }
}